package No0001_two_sum

func twoSum(nums []int, target int) []int {
	var tmpMap = make(map[int]int)
	l := len(nums)
	for i := 0; i < l; i++ {
		pair, exist := tmpMap[nums[i]]
		if exist {
			return []int{pair, i}
		} else {
			tmpMap[target-nums[i]] = i
		}
	}
	return nil
}

var Solution func(nums []int, target int) []int = twoSum
